package com.chang.dao.server; 

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; 

public class Server { 

  public static void main(String[] args) { 

     System.out.println("开启webservice。。。"); 
     SayHelloService sayHelloService = new SayHelloServiceImpl(); 
     String address = "http://localhost:8080/web"; 

      JaxWsServerFactoryBean factoryBean = new JaxWsServerFactoryBean(); 
      factoryBean.setAddress(address); // 设置暴露地址 
      factoryBean.setServiceClass(SayHelloService.class); // 设置接口类 
      factoryBean.setServiceBean(sayHelloService); // 设置实现类 
      factoryBean.create(); 
      System.out.println("开启webservice成功。。。"); 
   } 

} 
